package ycl.system.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
import ycl.common.base.mapper.BaseDao;
import ycl.system.entity.SysMenu;
import ycl.system.res.SysMenuRes;

import java.util.List;

/**
 * <p>
 * 菜单 Mapper 接口
 * </p>
 *
 * @author ycl
 * @since 2022-03-03 11:43:56
 */
@Repository
@Mapper
public interface SysMenuMapper extends BaseDao<SysMenu> {


	@Select("select * from sys_menu where type = 'ROOT' limit 1")
	SysMenu selectRoot();


	@Select("select * from sys_menu sm where sm.parent_id = #{pid} order by sm.sorts")
	List<SysMenuRes> selectByParentId(@Param("pid") Long parentId);
}
